package com.ruoyi.dash.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.dash.mapper.TbDynamicDataConfigMapper;
import com.ruoyi.dash.domain.TbDynamicDataConfig;
import com.ruoyi.dash.service.ITbDynamicDataConfigService;

/**
 * 动态数据配置Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-10-22
 */
@Service
public class TbDynamicDataConfigServiceImpl implements ITbDynamicDataConfigService 
{
    @Autowired
    private TbDynamicDataConfigMapper tbDynamicDataConfigMapper;

    /**
     * 查询动态数据配置
     * 
     * @param id 动态数据配置主键
     * @return 动态数据配置
     */
    @Override
    public TbDynamicDataConfig selectTbDynamicDataConfigById(Long id)
    {
        return tbDynamicDataConfigMapper.selectTbDynamicDataConfigById(id);
    }

    /**
     * 查询动态数据配置列表
     * 
     * @param tbDynamicDataConfig 动态数据配置
     * @return 动态数据配置
     */
    @Override
    public List<TbDynamicDataConfig> selectTbDynamicDataConfigList(TbDynamicDataConfig tbDynamicDataConfig)
    {
        return tbDynamicDataConfigMapper.selectTbDynamicDataConfigList(tbDynamicDataConfig);
    }

    /**
     * 新增动态数据配置
     * 
     * @param tbDynamicDataConfig 动态数据配置
     * @return 结果
     */
    @Override
    public int insertTbDynamicDataConfig(TbDynamicDataConfig tbDynamicDataConfig)
    {
        tbDynamicDataConfig.setCreateTime(DateUtils.getNowDate());
        return tbDynamicDataConfigMapper.insertTbDynamicDataConfig(tbDynamicDataConfig);
    }

    /**
     * 修改动态数据配置
     * 
     * @param tbDynamicDataConfig 动态数据配置
     * @return 结果
     */
    @Override
    public int updateTbDynamicDataConfig(TbDynamicDataConfig tbDynamicDataConfig)
    {
        tbDynamicDataConfig.setUpdateTime(DateUtils.getNowDate());
        return tbDynamicDataConfigMapper.updateTbDynamicDataConfig(tbDynamicDataConfig);
    }

    /**
     * 批量删除动态数据配置
     * 
     * @param ids 需要删除的动态数据配置主键
     * @return 结果
     */
    @Override
    public int deleteTbDynamicDataConfigByIds(Long[] ids)
    {
        return tbDynamicDataConfigMapper.deleteTbDynamicDataConfigByIds(ids);
    }

    /**
     * 删除动态数据配置信息
     * 
     * @param id 动态数据配置主键
     * @return 结果
     */
    @Override
    public int deleteTbDynamicDataConfigById(Long id)
    {
        return tbDynamicDataConfigMapper.deleteTbDynamicDataConfigById(id);
    }
}
